load("//bazel:macros.bzl", "exports_files_legacy", "split_srcs_and_hdrs")

licenses(["notice"])

exports_files_legacy()

CORE_FILES = [
    "SkImage.cpp",
    "SkImage_Base.h",
    "SkImage_Lazy.cpp",
    "SkImage_Lazy.h",
    "SkImage_Raster.cpp",
    "SkReadPixelsRec.h",
    "SkRescaleAndReadPixels.cpp",
    "SkRescaleAndReadPixels.h",
    "SkSurface.cpp",
    "SkSurface_Base.h",
    "SkSurface_Raster.cpp",
]

split_srcs_and_hdrs(
    name = "core",
    files = CORE_FILES,
)

GPU_FILES = [
    "SkImage_Gpu.cpp",
    "SkImage_Gpu.h",
    "SkImage_GpuBase.cpp",
    "SkImage_GpuBase.h",
    "SkImage_GpuYUVA.cpp",
    "SkImage_GpuYUVA.h",
    "SkSurface_Gpu.cpp",
    "SkSurface_Gpu.h",
]

split_srcs_and_hdrs(
    name = "gpu",
    files = GPU_FILES,
)

filegroup(
    name = "srcs",
    srcs = [":core_srcs"] + select({
        "//src/gpu:has_gpu_backend": [":gpu_srcs"],
        "//conditions:default": [],
    }),
    visibility = ["//src:__pkg__"],
)

filegroup(
    name = "private_hdrs",
    srcs = [":core_hdrs"] + select({
        "//src/gpu:has_gpu_backend": [":gpu_hdrs"],
        "//conditions:default": [],
    }),
    visibility = ["//src:__pkg__"],
)
